package com.huike.web.controller.report;

import com.huike.common.core.domain.AjaxResult;
import com.huike.report.domain.vo.CluesVo;
import com.huike.report.service.ReportService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import com.huike.common.core.controller.BaseController;

import java.util.List;
import java.util.Map;


@RestController
@RequestMapping("/report")
public class ReportController extends BaseController {
    @Autowired
    private ReportService reportService;

    //统计分析--线索统计--新增线索数量折线图
    @GetMapping("/cluesStatistics/{beginCreateTime}/{endCreateTime}")
    public CluesVo getCluesStatistics(@PathVariable String beginCreateTime, @PathVariable String endCreateTime){
        CluesVo cluesStatistics = reportService.getCluesStatistics(beginCreateTime, endCreateTime);
        return  cluesStatistics;
    }

    //统计分析 客户统计 学科客户分布饼图
    @GetMapping("/subjectStatistics/{beginCreateTime}/{endCreateTime}")
    public AjaxResult getSubjectStatistics(@PathVariable String beginCreateTime, @PathVariable String endCreateTime) {
        List<Map<String,Object>> contractStatistics = reportService.getSubjectStatistics(beginCreateTime, endCreateTime);
        return AjaxResult.success(contractStatistics);
    }


}